<!--#include file="Config.asp"-->
<!--#include file="isUser.asp"-->
<!--#include file="Header.asp"-->

<%

intID=int(Request("id"))
ActionType=request("ActionType")
SaveType=request("SaveType")
set rs=server.createobject("adodb.recordset")

'Add
if ActionType="Add" or ActionType="" then
AName="确定增加"
URL="?SaveType=AddOK"
end if

'Mod
if ActionType="Mod" and intID<>"" then
AName="确定修改"
sql="select * from Emp_State where id="&Intid
rs.open sql,conn,1,1
Brandname=rs("TypeName")
BrandID=int(rs("id"))
rs.close
AID=intID
URL="?SaveType=ModOK&ID="&intID
end if

'SaveAdd
if SaveType="AddOK" and request("name")<>"" then
sql="select * from Emp_State where id is null"
rs.open sql,conn,1,3
rs.addnew
rs("TypeName")=Request("name")
rs.Update
rs.close
end if

'SaveMod
if SaveType="ModOK" and intID<>"" and request("name")<>"" then
sql="select * from Emp_State where id="&IntID
rs.open sql,conn,1,3
rs("TypeName")=Request("name")
rs.Update
rs.close

end if
%>
<!--添加  -->
<table class="table table-condensed table-striped table-hover table-bordered">
<form method="post" action="<%=URL%>" name="form1">
<tr>
<td>
<input type="text" name="name" value="<%=Brandname%>">
<input type="submit" name="Submit" value="<%=aname%>">
<A HREF="?ActionType=Add">[<U><FONT COLOR="#FF0000"><B>增加</B></FONT></U>]</A>
</td>
</tr>
</form>
</table>

<table class="table table-condensed table-striped table-hover table-bordered">
	<tr>
		<td>ID</td>
		<td>名称/点击修改</td>
	</tr>
<%
sql="select * from Emp_State order by id"
rs.open sql,conn,1,1
for r=1 to rs.recordcount
%>
<tr >
<TD><%=rs("id")%></td>
<TD><A HREF="?ActionType=Mod&ID=<%=rs("id")%>" title='点击修改<%=rs("TypeName")%>'><U>[<%=trim(rs("id"))%>.<%=trim(rs("TypeName"))%>]</U></A>
</td>
</tr>
<%
rs.moveNext
next
rs.close
%>

</TABLE>
<!--#include file="Footer.asp"-->